﻿<html>
<body>


<script type="text/javascript"; charset=utf-8>
document.write("您所添加的谐波如下");
 </script>

<script type="text/javascript"; charset=utf-8>

var index = 0;

function harm(phase, rms, dc, freq, degree)
{
	var is_voltage = 0;
	var rms_color = 0;
	if ( !phase.search("u") )
	{
		is_voltage = 1;
	} else {
		is_voltage = 0;
	}
	if ( phase=="ua" || phase == "ia" )
	{
		rms_color = "Orange";// instead of Yellow
	} else if ( phase=="ub" || phase == "ib" )
	{
		rms_color = "SeaGreen";
	} else if ( phase=="uc" || phase == "ic" ) 
	{
		rms_color = "DeepPink";
	} else {
		rms_color = "RoyalBlue";
	}

	document.write("<tr>");
	document.write("<td align=\"center\" bgcolor=", rms_color, ">", index++,"</td>" );
	document.write(	"<td align=\"center\" bgcolor=", rms_color, ">", phase, "</td>")
	if ( is_voltage )
	{
		document.write(	"<td align=\"center\" bgcolor=", rms_color, ">", rms, "V</td>")
		document.write(	"<td align=\"center\" bgcolor=", rms_color, ">", dc, "V</td>")
	} else {
		document.write(	"<td align=\"center\" bgcolor=", rms_color, ">", rms, "A</td>")
		document.write(	"<td align=\"center\" bgcolor=", rms_color, ">", dc, "A</td>")
	}
	var hi = "??";
	if ( freq >= 2000 ) {
		hi = 1 + (freq-2000) / 200;
	}
	document.write(	"<td align=\"center\" bgcolor=", rms_color, ">", freq, "Hz 第", freq/50,  "次谐波,第", hi, "次高次谐波</td>")
	document.write(	"<td align=\"center\" bgcolor=", rms_color, ">", degree, "°</td>")
	document.write("</tr>")

//	document.write( "[", index++,  "] wave add: ", phase, "rms=", rms, " dc=", dc, " freq=", freq, " degree=", degree, "<br/>"  )
}

// 表头
document.write("<table border=\"10\" width=\"80%\">");
document.write("<tbody>");
document.write("<tr>");
document.write("<td align=\"center\">序号</td>" );
document.write(	"<td align=\"center\">相名</td>")
document.write(	"<td align=\"center\">有效值</td>")
document.write(	"<td align=\"center\">直流分量</td>")
document.write(	"<td align=\"center\">频率/Hz</td>")
document.write(	"<td align=\"center\">角度/°</td>")
document.write("</tr>")

</script>

 <script type="text/javascript" src="./simulation.js"></script>>


<script type="text/javascript"; charset=utf-8>
document.write("<tr>");
document.write("<td align=\"center\">序号</td>" );
document.write(			"<td align=\"center\">相名</td>")
document.write(			"<td align=\"center\">有效值	</td>")
document.write(			"<td align=\"center\">直流分量</td>")
document.write(			"<td align=\"center\">频率/Hz</td>")
document.write(			"<td align=\"center\">角度/°</td>")
document.write(		"</tr>")

document.write(	"</tbody>")
document.write("</table>")


</script>
</body>
</html>

